package com.fruitshop.util;

import com.fruitshop.model.Command;

public class PrintUtils {

    public static final String ANSI_RESET = "\u001B[0m";
    public static final String ANSI_BLACK = "\u001B[30m";
    public static final String ANSI_RED = "\u001B[31m";
    public static final String ANSI_GREEN = "\u001B[32m";
    public static final String ANSI_YELLOW = "\u001B[33m";
    public static final String ANSI_BLUE = "\u001B[34m";
    public static final String ANSI_PURPLE = "\u001B[35m";
    public static final String ANSI_CYAN = "\u001B[36m";
    public static final String ANSI_WHITE = "\u001B[37m";
    // 打印新行
    public static void newLine() {
        System.out.println();
    }

    public static void printError(String error){
        System.out.println(ANSI_RED + error+ANSI_RESET);
    }

    public static void printHighLight(String message){
        System.out.println(ANSI_YELLOW + message+ANSI_RESET);
    }

    public static void println(String message, Object... args) {
        System.out.printf(message,args);
        System.out.println();
    }

    public static void println(String message) {
        System.out.println(message);
    }

    public static void printCommand(Command command) {
        System.out.printf("%6s: %s\n",command.getId(),command.getName());
    }
}
